import java.lang.Exception

fun main() {
    val number:Int? = null
    try {
        checkOperation(number)
        number!!.plus(1)
    } catch (e:Exception) {
        println(e)
    }
}

fun checkOperation(number:Int?){
    //自定义异常
    //number?:throw UnskilledException()
    //内置函数
    checkNotNull(number,{"something is error"})
}

//自定义异常
class UnskilledException():IllegalArgumentException("操作不当")